<?php

/**
 * Yii Controller WidgetController
 *
 * @author nguyenmanhluu
 * @since Aug 19, 2013 - 6:42:10 PM
 */
class WidgetController extends MyController
{

    public function actionIndex()
    {
        $layouts = Layout::model()->findAll();
        $this->render('index', array(
            'layouts' => $layouts
        ));
    }

    public function actionLayout()
    {
        $layout_id = $_GET['pk'];
        $columns   = LayoutColumn::model()->findAll('layout_id=:l', array(
            ':l' => $layout_id
        ));

        $widget_template = Widget::model()->findAll('type=:t', array(
            ':t' => Widget::TYPE_TEMPLATE
        ));

        $this->render('layout', array(
            'columns'         => $columns,
            'widget_template' => $widget_template,
        ));
    }

    public function actionUpdate()
    {
        
    }

    public function actionCreate()
    {
        
    }

    public function actionDelete()
    {
        
    }

}

/** 
 * End file WidgetController
 */
